<?php
/**
 * 技能
 *
 * @author 耿鸿飞 <15911185633>
 */
class Sys_Skill extends Model
{
    protected $tbl = 'sys_skill';
    
    public function addSkill($name){
        $data = array("Fname" => $name);
        return $this->insert($data);
    }
    public function getSkillName($fsid){
        return $this->getVar(sprintf("SELECT Fname FROM %s WHERE Fsid=%d",  $this->tbl,$fsid));
    }
    public function getSkillNames($fsids){
        $rs = array();
        if(is_array($fsids)){
            $sql = sprintf("SELECT * FROM %s WHERE Fsid IN(%s)",  $this->tbl,  implode(',', $fsids));
            $list = $this->getResults($sql);
            if($list){
                foreach($list AS $val){
                    $rs[$val['Fsid']] = $val['Fname'];
                }
            }
        }
        return $rs;
    }
}

?>
